package com.ruoyi.smartHighway.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartHighway.mapper.RoadBreakMapper;
import com.ruoyi.smartHighway.domain.RoadBreak;
import com.ruoyi.smartHighway.service.IRoadBreakService;

/**
 * 路面异常信息Service业务层处理
 * 
 * @author ljj
 * @date 2024-08-01
 */
@Service
public class RoadBreakServiceImpl implements IRoadBreakService {
    @Autowired
    private RoadBreakMapper roadBreakMapper;

    /**
     * 查询路面异常信息
     * 
     * @param breakId 路面异常信息主键
     * @return 路面异常信息
     */
    @Override
    public RoadBreak selectRoadBreakByBreakId(Long breakId) {
        return roadBreakMapper.selectRoadBreakByBreakId(breakId);
    }

    /**
     * 查询路面异常信息列表
     * 
     * @param roadBreak 路面异常信息
     * @return 路面异常信息
     */
    @Override
    public List<RoadBreak> selectRoadBreakList(RoadBreak roadBreak) {
        return roadBreakMapper.selectRoadBreakList(roadBreak);
    }

    /**
     * 新增路面异常信息
     * 
     * @param roadBreak 路面异常信息
     * @return 结果
     */
    @Override
    public int insertRoadBreak(RoadBreak roadBreak) {
        roadBreak.setCreateTime(DateUtils.getNowDate());
        return roadBreakMapper.insertRoadBreak(roadBreak);
    }

    /**
     * 修改路面异常信息
     * 
     * @param roadBreak 路面异常信息
     * @return 结果
     */
    @Override
    public int updateRoadBreak(RoadBreak roadBreak) {
        roadBreak.setUpdateTime(DateUtils.getNowDate());
        return roadBreakMapper.updateRoadBreak(roadBreak);
    }

    /**
     * 批量删除路面异常信息
     * 
     * @param breakIds 需要删除的路面异常信息主键
     * @return 结果
     */
    @Override
    public int deleteRoadBreakByBreakIds(Long[] breakIds) {
        return roadBreakMapper.deleteRoadBreakByBreakIds(breakIds);
    }

    /**
     * 删除路面异常信息信息
     * 
     * @param breakId 路面异常信息主键
     * @return 结果
     */
    @Override
    public int deleteRoadBreakByBreakId(Long breakId)
    {
        return roadBreakMapper.deleteRoadBreakByBreakId(breakId);
    }
}
